package classicsPrograms;

public class TestSingleton1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Singleton1 test = Singleton1.getSingleton();
		new MyThread().start();
		for(int i=0;i<200;i++){
			System.out.println(Thread.currentThread().getName()+":"+ ++test.i);
		}

	}

}
class MyThread extends Thread{
	public void run(){
		Singleton1 ton1 = Singleton1.getSingleton();
		for(int i=0;i<200;i++){
			System.out.println(Thread.currentThread().getName()+":"+ ++ton1.i);
		}
	}
}